<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <script>
      window.log = console.log;
    </script>
    <script src="/dist/vue.js"></script>
    <!--    <script src="../dist/main.js"></script>-->
    <div id="app" style="color: green">
      <div style="color: #ff0000">你好{{age}}hello{{name}}world</div>
      <div style="color: #ff0000">{{name}}</div>
      <div>{{age}}</div>
    </div>

    <script>
      // 1. 模板编译  -->   render()
      // 2. 到 vm 实例上取值
      // 3. render() --> ast
      // 4. ast ---> vnode(diff算法)
      // 5. vnode --> dom
      const vm = new Vue({
        el: "#app",
        data() {
          return {
            name: "刚刚刚",
            age: 23,
          };
        },
      });
      setTimeout(() => {
        vm.name = "fsfsdf";
        vm.name = "dsd";
        vm.age = "43543";
        vm.name = "最后一次更新";
        vm.$nextTick(() => {
          log(vm.$options.el.innerHTML + "\n");
        });
      }, 3000);
      // log(vm.name.push("4545"));
      // log(vm.name);
    </script>
  </body>
</html>
